﻿var zombies = zombies || {};

zombies.aboutPubliser = function () {
    var self = this;
    //edit information
    self.ChannelName = ko.observable();
    self.About = ko.observable();
    self.PubId = ko.observable();
};

var loadChanel = function (pubId) {
    $.ajax({
        type: "GET",
        url: "/api/Publisher/GetPubChannel/" + pubId,
        contentType: "application/json",
        dataType: 'json'
    }).done(function (item) {
        aboutPubModel.PubId(item.PubId);
        aboutPubModel.ChannelName(item.ChannelName);
        aboutPubModel.About(item.About);
    }).fail(function () {
    });
};

var pubId = document.URL.split('/').pop();

var aboutPubModel;
$(document).ready(function () {
    aboutPubModel = new zombies.aboutPubliser();
    loadChanel(pubId);

    ko.applyBindings(aboutPubModel, document.getElementById("channel_content"));
});